package com.easy.web.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Packge com.easy.web.config
 * @Autor linNaibin
 * @Description
 * @Version 1.0
 * @Date 2021/12/11 16:16
 */
@Configuration
//public class WebMvcConfig extends WebMvcConfigurationSupport {
// extends WebMvcConfigurationSupport 可能导致某些静态资源失效，例如swagger 打不开
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/file/**").addResourceLocations("file:" + "D:\\workspace\\easy-study\\easy-log4j-bug\\target\\classes\\com\\easy\\log4j\\");

        /* swagger-ui 配置*/
        //   registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/");
        WebMvcConfigurer.super.addResourceHandlers(registry);

    }


}
